package com.shuoyue.ycgk.ui.recruitment;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.RecruitmentItem;

import java.util.List;

public class NoticeMainAdapter extends AppBaseQuickAdapter<RecruitmentItem> {

    public NoticeMainAdapter(@Nullable List<RecruitmentItem> data) {
        super(R.layout.item_recuri_home, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, RecruitmentItem item) {
        helper.addOnClickListener(R.id.lay_all);
        helper.setText(R.id.title, "                   " + item.getTitle());
//        helper.setText(R.id.info, "招" + item.getEnrollment() + "人/"
//        + item.getPostNum() + "个职位");//招10人/15个职位
        helper.setGone(R.id.hot,item.getIsIndex()==1);
        helper.setText(R.id.info, "招" + item.getEnrollment() + "人/"
                + item.getPostNum() + "个职位");
        if (item.getStatus() == 1) {
            helper.setText(R.id.tag, "即将报名");
            helper.setBackgroundRes(R.id.tag, R.mipmap.tag_in_blue);
        } else if (item.getStatus() == 0) {
            helper.setText(R.id.tag, "正在报名");
            helper.setBackgroundRes(R.id.tag, R.mipmap.tag_in_orange);
        } else {
            helper.setText(R.id.tag, "报名结束");
            helper.setBackgroundRes(R.id.tag, R.mipmap.tag_in_gray);

        }
    }


}
